//
//  UserCourseCollectionViewCell.m
//  HandWork
//
//  Created by 王阳阳 on 16/2/27.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "UserCourseCollectionViewCell.h"

@implementation UserCourseCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creat];
    }
    return self;
}

- (void)creat
{
    //图片
    
    self.bgimg = [[UIImageView alloc]init];
    [self.contentView addSubview:self.bgimg];
    [_bgimg release];
    
    //标题
    self.name  = [[UILabel alloc]init];
    [self.contentView addSubview:self.name];
    [_name release];
    
    // 人气和赞
    self.other = [[UILabel alloc]init];
    self.other.font = [UIFont systemFontOfSize:10];
    self.other.textColor = [UIColor grayColor];
    [self.contentView addSubview:self.other];
    [_other release];
    
    //时间
    self.timelabel = [[UILabel alloc]init];
    self.timelabel.font = [UIFont systemFontOfSize:10];
    self.timelabel.textColor =[UIColor grayColor];
    [self.contentView addSubview:self.timelabel];
    [_timelabel release];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.bgimg.frame = CGRectMake(0, 0, self.contentView.frame.size.width, 140);
    
    self.name.frame = CGRectMake(0, 140, self.contentView.frame.size.width, 30);
    
    self.other.frame = CGRectMake(0, 170, self.contentView.frame.size.width / 2, 30);
    self.timelabel.frame = CGRectMake(self.other.frame.size.width, 170, self.contentView.frame.size.width / 2, 30);
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
